#coding=UTF-8
require 'rexml/document'
include REXML



file = []
doc = Document.new(File.new("Personnes.xml"))

doc.root.each_element('pers:CV/pers:NomFichier') do |e|
  file << e.text
end


file.each do |path|
  sortie = "../CVsHtml/#{path.reverse[4, path.size].reverse}.html"
  File::open(sortie, File::WRONLY | File::CREAT) do |fic_out|
    STDOUT.reopen(fic_out)
    system("xsltproc CV.xsl ../CVsXML/#{path}")
  end
end
